package com.nameless.controller;

import com.nameless.entity.MaintainRecord;
import com.nameless.service.MaintainRecordService;
import com.nameless.vo.MaintainRecordVo;
import com.nameless.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author keluoyisi
 * @program: car-parent
 * @description: 维修记录
 * @date 2023-02-28 14:43:24
 */
@RestController
@RequestMapping("/car/maintainRecord")
public class MaintainRecordController {
    @Autowired
    private MaintainRecordService maintainRecordService;

    @PostMapping("/queryAllByParam")
    public Result queryAllByParam(@RequestBody MaintainRecordVo maintainRecordVo){
        System.out.println("11111111111111111111111111111111111111111111111111111111"+maintainRecordVo);
        return maintainRecordService.queryAllByParam(maintainRecordVo);
    }

    @PutMapping("/update")
    public Result updateMaintainRecord(@RequestBody MaintainRecord maintainRecord){
        return maintainRecordService.updateMaintainRecord(maintainRecord);
    }

    @PutMapping("/insert")
    public Result insertMaintainRecord(@RequestBody MaintainRecord maintainRecord){
        return maintainRecordService.insertMaintainRecord(maintainRecord);
    }
    @DeleteMapping("/deleteById")
    public Result deleteMaintainRecordById(Integer id){
        return maintainRecordService.deleteMaintainRecordById(id);
    }
}
